package com.leyou;

import com.leyou.common.constants.MQConstants;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.HashMap;
import java.util.Map;

import static com.leyou.common.constants.MQConstants.RoutingKey.VERIFY_CODE_KEY;

@RunWith(SpringRunner.class)
@SpringBootTest
public class smsText {

    @Autowired
    private AmqpTemplate amqpTemplate;

    @Test
    public void test() throws InterruptedException {
        Map<String,String> map = new HashMap<>();
        map.put("phone", "18225610586");
        map.put("code", "981015");
        this.amqpTemplate.convertAndSend(MQConstants.Exchange.SMS_EXCHANGE_NAME, VERIFY_CODE_KEY, map);

        //Thread.sleep(5000);
    }
}
